<?php

namespace App\Models;

/**
 * App\Models\UserWeixin
 *
 * @property int $id
 * @property int $user_id 用户id
 * @property string $nickname
 * @property string $avatar
 * @property string $openid
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \App\Models\User $user
 * @method static \Illuminate\Database\Eloquent\Builder|UserWeixin newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|UserWeixin newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Model orderCheck($request)
 * @method static \Illuminate\Database\Eloquent\Builder|Model pageCheck($request, $field = [], $makeVisible = [])
 * @method static \Illuminate\Database\Eloquent\Builder|UserWeixin query()
 * @method static \Illuminate\Database\Eloquent\Builder|UserWeixin whereAvatar($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserWeixin whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserWeixin whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserWeixin whereNickname($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserWeixin whereOpenid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserWeixin whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserWeixin whereUserId($value)
 * @mixin \Eloquent
 */
class UserWeixin extends Model
{
    protected $table = 'user_weixin';

    protected $primaryKey = 'id';

    protected $fillable = ['nickname', 'avatar', 'openid'];

    public function user()
    {
        return $this->belongsTo(User::class,'user_id','id');
    }
}
